﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CoreEx.Common.Validation;
using CoreEx.Samples.DomainModel;
using LinFu.IoC.Configuration;

namespace CoreEx.Common.Tests
{
    [Implements(typeof(IRuleInjector<OrderDetail>))]
    public class SampleRuleInjector : IRuleInjector<OrderDetail>
    {
        public void Inject(IValidationRules<OrderDetail> validationRules)
        {
            validationRules.AddRule(od => (decimal)od.Discount < od.UnitPrice
                ,"Discount must be less than the unit price");
        }
    }
    
}
